<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.List,java.util.Map;"%>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c"%>
<fieldset>
	<legend> &nbsp;&nbsp;&nbsp;&nbsp; 流程批阅 </legend>
		<div id="tabpanel">
			<ul class="nav nav-tabs">
				<li class="active"><a href="#deal" data-toggle="tab">流程处理</a></li>
				<li><a href="#log" data-toggle="tab">审批记录</a></li>
			</ul>

			<!-- Tab panes -->
			<div class="tab-content">
				<div class="tab-pane active" id="deal">
					<form  class="form-horizontal" role="form"
						action='<%=request.getContextPath()%>/c?s=wf&o=process&key=${key}&p_entry=${p_entry}&p_node=${p_node}'
						 method="post" id='form-process'>
						 
					<div class="control-group">
						<label class="control-label">关联操作：</label>
						<div class="controls">
							<a href=""><i class="icon-hand-right"></i> 点击查看</a>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">处理结果：</label>
						<div class="controls">
							<c:if test="${p_result eq 'start' }">
							<input type="radio" name="p_deal_result" value="start" checked='checked' />
							<span><i class="icon-caret-right"></i> 送审</span>
							</c:if>
							<c:if test="${p_result ne 'start' }">
							<c:forEach var="rst" items="${result }">
							<input type="radio" name="p_deal_result" value="${rst.k }" <c:if test="${rst.k eq 'approve'}">checked='checked'</c:if>/>
							<span><i class="icon-caret-right"></i> ${rst.v }</span>
							</c:forEach>
							</c:if>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">处理意见：</label>
						<div class="controls">
							<textarea name="p_deal_comment" rows="3" class="form-control"><c:if test="${p_result eq 'start' }">${m_reason }</c:if></textarea>
						</div>
					</div>
					<c:if test="${next_users ne null }">
					<div class="control-group">
						<label class="control-label">提交给：</label>
						<div class="controls">
							<select name="p_next_user">
								<c:forEach var="u" items="${next_users }">
									<option value="${u.k }">${u.v }</option>
								</c:forEach>
							</select>
						</div>
					</div>
					</c:if>
					<c:if test="${p_result ne 'start' }">
					<div class="control-group">
						<label class="control-label">上传附件：</label>
						<div class="controls">
							<input type="text" class="file-input form-control" name="p_attach" />
							<input type="hidden" id="p_attach-guid" name="guid" value="" /> 
							<input type="hidden" id="p_attach-ext" name="file_type" value="" />
						</div>
					</div>
					</c:if>
					<div class="form-actions">
						<button class="btn btn-primary btn-ajax-save" isajax="0"  type="button">
							<i class="icon-save"></i> <span>保存</span>
						</button>
						
						<button class="btn btn-ajax-back" type="button">
							<i class="icon-reply"></i> <span>返回</span>
						</button>
					</div>
					</form>
					<div class="remark-log dl">
						<h4>流程备注</h4>
						<dl>
						<c:forEach var="r" items="${remarks }">
							<dt>${r.n_code}:${r.n_title }</dt>
							<dd><p>${r.n_remark }</p></dd>
						</c:forEach>
						</dl>
					</div>
				</div>
				<div class="tab-pane" id="log">
					<c:if test="${ logs ne null}">
					<div class="process-log dl">
						<h4>审批日志</h4>
						<dl>
							<c:forEach var="l" items="${logs }">
								<dt>
									${l.ui_nickname } 予以【
									<c:choose>
										<c:when test="${l.p_deal_result eq 'start' }">提交</c:when>
										<c:when test="${l.p_deal_result eq 'reject' }">驳回</c:when>
										<c:when test="${l.p_deal_result eq 'stop' }">终止</c:when>
										<c:when test="${l.p_deal_result eq 'approve' }">通过</c:when>
									</c:choose>
									】 于 ${l.p_deal_date }
								</dt>
								<dd>
									<p>意见如下：${l.p_deal_comment}</p>
									<p>
										附件：<a href="<%=request.getContextPath()%>/f?guid=${l.guid }">${l.p_attach}</a>
									</p>
								</dd>
							</c:forEach>
						</dl>
					</div>
					</c:if>
				</div>	
			</div>
		</div>
</fieldset>
<%-- --%>

<!-- Modal -->
<div class="modal fade" id="uploadForm" tabindex="-1" role="dialog"
	aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<h4 class="modal-title" id="myModalLabel">附件上传</h4>
			</div>
			<div class="modal-body">
				<form action="<%=request.getContextPath()%>/f?o=upload"
					enctype='multipart/form-data' method="POST">
					<div id="spinner-div">
						<i class="icon-spinner icon-spin"></i>
					</div>
					<input type="file" name="attach_file" />
					<button class="btn btn-primary btn-lg" type="button">
						<i class="icon-upload"></i> 确定
					</button>
					<button class="btn btn-danger btn-lg" type="button">
						<i class="icon-remove"></i> 取消
					</button>
				</form>
			</div>

		</div>
		<!-- /.modal-content -->
	</div>
	<!-- /.modal-dialog -->
</div>
<!-- /.modal -->